package com.application.followdroid;

import java.util.LinkedList;
import java.util.List;

import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.content.Context;
import com.google.android.maps.GeoPoint;
import com.google.android.maps.ItemizedOverlay;
import com.google.android.maps.MapView;
import com.google.android.maps.OverlayItem;



public class OverlayFriends extends ItemizedOverlay<OverlayItem>
{
        private List<OverlayItem> friend = new LinkedList<OverlayItem>();
        private Drawable defaultMarker;
        private Context mContext;
        
        public OverlayFriends(Context context, Drawable defaultMarker,int latit,int longit) {
                super(defaultMarker);
                mContext = context;
                this.defaultMarker = defaultMarker;
                
                // Aggiungiamo l'OverlayItem
                friend.add(new OverlayItem(new GeoPoint(latit,longit),"",""));
                //interesse.add(new OverlayItem(new GeoPoint(43429915,12934974),"Genga","frik"));
                //interesse.add(new OverlayItem(new GeoPoint(43402194,12967879),"Museo","frik"));

                populate();
        }
        
        
        @Override
        public void draw(Canvas canvas, MapView mapView, boolean shadow) 
        {
                super.draw(canvas, mapView, shadow);
                boundCenterBottom(defaultMarker);               
        }

        @Override
        protected OverlayItem createItem(int i) 
        {
                // Ritorniamo il riferimento all'i-esimo item
                return friend.get(i);
        }

        @Override
        protected boolean onTap(int i) 
        {
				return false;
        }
        
        @Override
        public int size() 
        {
                // Numero di elementi
                return friend.size();
        }
        
}
